package com.group01.service;

import com.group01.dto.Commodity.CommodityInsertInfoDTO;
import com.group01.dto.Commodity.CommodityUpdateInfoDTO;
import com.group01.pojo.Commodity;
import com.baomidou.mybatisplus.extension.service.IService;
import com.group01.result.PageTemplate;
import com.group01.result.Result;
import com.group01.vo.Commodity.*;

import java.util.List;

/**
* @author 19559
* @description 针对表【es_commodity(商品表)】的数据库操作Service
* @createDate 2024-06-21 15:21:49
*/
public interface CommodityService extends IService<Commodity> {

    Result<PageTemplate<CommodityGetPageVO>> getPage(Integer pageNum, Integer pageSize, Integer categoryId, String query);

    Result<List<CommodityGetInfoByCateIdVO>> getBooksByCategoryId(Integer categoryId);

    Result<CommodityGetInfoByIdVO> getCommodityById(Integer id);

    Result<String> addCommodity(CommodityInsertInfoDTO commodityInsertInfoDTO);

    Result<String> updateCommodityStatus(Integer id, Integer status);

    Result<String> updateCommodity(CommodityUpdateInfoDTO commodityUpdateInfoDTO);

    Result<String> deleteCommodityById(Integer id);

    Result<String> deleteCommodityByIds(List<Integer> ids);

    Result<List<CommodityShowVO>> showBooks();

    Result<List<CommodityShowVO>> searchBook(String query);

    Result<List<CommodityInfoVO>> findByCategory(Integer id);

    Result<CommodityGetPageVO> getCommodityByIdForBackend(Integer id);

    Result<List<CommodityShowVO>> getAllBooks(Integer pageNum, Integer pageSize);
}
